<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   Python语言十分钟快速入门  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://dataunion.org/24107.html",
                  host: "http://dataunion.org",
                  prePath: "http://dataunion.org",
                  scheme: "http",
                  pathBase: "http://dataunion.org/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466460626: Accept with keywords: (title(0.2):Python,社区,数盟,语言,入门, topn(0.333333333333):社区,语言,数盟,行业资讯,数组,数据挖掘,函数,Python,元素,入门,缺省,关键字,参数,文章,类型,基础架构,默认值,字典,教程,变量,对象,元组,运算符,字符串,声明,语句,语法,编程语言,代码,列表).-->
 </head>
 <body onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    Python语言十分钟快速入门
   </h1>
  </div>
  <div class="container" id="xmain">
   ﻿﻿
   <title>
    Python语言十分钟快速入门 | 数盟社区
   </title>
   <!-- All in One SEO Pack 2.2.7.6.2 by Michael Torbert of Semper Fi Web Design[32,62] -->
   <!-- /all in one seo pack -->
   <!--
<div align="center">
<a href="http://strata.oreilly.com.cn/hadoop-big-data-cn?cmp=mp-data-confreg-home-stcn16_dataunion_pc" target="_blank"><img src="http://dataunion.org/wp-content/uploads/2016/05/stratabj.jpg"/ ></a>
</div>
-->
   <header id="header-web">
    <div class="header-main">
     <hgroup class="logo">
      <h1>
       <a href="http://dataunion.org/" rel="home" title="数盟社区">
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/logo.png"/>
       </a>
      </h1>
     </hgroup>
     <!--logo-->
     <nav class="header-nav">
      <ul class="menu" id="menu-%e4%b8%bb%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-71" id="menu-item-71">
        <a href="http://dataunion.org/category/events" title="events">
         活动
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22457" id="menu-item-22457">
          <a href="http://dataunion.org/2016timeline">
           2016档期
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22459" id="menu-item-22459">
          <a href="http://dataunion.org/category/parterc">
           合作会议
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor menu-item-has-children menu-item-20869" id="menu-item-20869">
        <a href="http://dataunion.org/category/tech" title="articles">
         文章
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20867" id="menu-item-20867">
          <a href="http://dataunion.org/category/tech/base" title="base">
           基础架构
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3302" id="menu-item-3302">
          <a href="http://dataunion.org/category/tech/ai" title="ai">
           人工智能
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3303" id="menu-item-3303">
          <a href="http://dataunion.org/category/tech/analysis" title="analysis">
           数据分析
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21920" id="menu-item-21920">
          <a href="http://dataunion.org/category/tech/dm">
           数据挖掘
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3314" id="menu-item-3314">
          <a href="http://dataunion.org/category/tech/viz" title="viz">
           可视化
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-3305" id="menu-item-3305">
          <a href="http://dataunion.org/category/tech/devl" title="devl">
           编程语言
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-20876" id="menu-item-20876">
        <a href="http://dataunion.org/category/industry">
         行业
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-16328" id="menu-item-16328">
          <a href="http://dataunion.org/category/industry/case" title="case">
           行业应用
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-2112" id="menu-item-2112">
          <a href="http://dataunion.org/category/industry/demo" title="demo">
           Demo展示
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21562" id="menu-item-21562">
          <a href="http://dataunion.org/category/industry/news">
           行业资讯
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-311" id="menu-item-311">
        <a href="http://dataunion.org/category/sources" title="sources">
         资源
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20870" id="menu-item-20870">
        <a href="http://dataunion.org/category/books" title="book">
         图书
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21363" id="menu-item-21363">
        <a href="http://dataunion.org/category/training">
         课程
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-21853" id="menu-item-21853">
        <a href="http://dataunion.org/category/jobs">
         职位
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22050" id="menu-item-22050">
          <a href="http://dataunion.org/category/career">
           职业规划
          </a>
         </li>
        </ul>
       </li>
      </ul>
     </nav>
     <!--header-nav-->
    </div>
   </header>
   <!--header-web-->
   <div id="main">
    <div id="soutab">
     <form action="http://dataunion.org/" class="search" method="get">
     </form>
    </div>
    <div id="container">
     <nav id="mbx">
      当前位置：
      <a href="http://dataunion.org">
       首页
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech">
       文章
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech/devl">
       编程语言
      </a>
      &gt;  正文
     </nav>
     <!--mbx-->
     <article class="content">
      <header align="centre" class="contenttitle">
       <div class="mscc">
        <h1 class="mscctitle">
         <a href="http://dataunion.org/24107.html">
          Python语言十分钟快速入门
         </a>
        </h1>
        <address class="msccaddress ">
         <em>
          755 次阅读 -
         </em>
         <a href="http://dataunion.org/category/tech/devl" rel="category tag">
          编程语言
         </a>
        </address>
       </div>
      </header>
      <div class="content-text">
       <div class="entry-content content0" id="content0">
        <p>
         假设你希望学习Python这门语言，却苦于找不到一个简短而全面的入门教程。那么本教程将花费十分钟的时间带你走入Python的大门。本文的内容介于教程(Toturial)和速查手册(CheatSheet)之间，因此只会包含一些基本概念。很显然，如果你希望真正学好一门语言，你还是需要亲自动手实践的。在此，我会假定你已经有了一定的编程基础，因此我会跳过大部分非Python语言的相关内容。本文将高亮显示重要的关键字，以便你可以很容易看到它们。另外需要注意的是，由于本教程篇幅有限，有很多内容我会直接使用代码来说明加以少许注释。
        </p>
        <h2>
         Python的语言特性
        </h2>
        <p>
         Python是一门具有强类型(即变量类型是强制要求的)、动态性、隐式类型(不需要做变量声明)、大小写敏感(var和VAR代表了不同的变量)以及面向对象(一切皆为对象)等特点的编程语言。
        </p>
        <h2>
         获取帮助
        </h2>
        <p>
         你可以很容易的通过Python解释器获取帮助。如果你想知道一个对象(object)是如何工作的，那么你所需要做的就是调用help(&lt;object&gt;)！另外还有一些有用的方法，dir()会显示该对象的所有方法，还有&lt;object&gt;.__doc__会显示其文档：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198cfe988425207" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           &gt;&gt;&gt; help(5)
Help on int object:
(etc etc)

&gt;&gt;&gt; dir(5)
['__abs__', '__add__', ...]

&gt;&gt;&gt; abs.__doc__
'abs(number) -&gt; number

Return the absolute value of the argument.'
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198cfe988425207-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198cfe988425207-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198cfe988425207-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198cfe988425207-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198cfe988425207-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198cfe988425207-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198cfe988425207-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198cfe988425207-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198cfe988425207-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198cfe988425207-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198cfe988425207-11">
                11
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198cfe988425207-1">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 help
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 5
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198cfe988425207-2">
                <span class="crayon-k ">
                 Help
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 on
                </span>
                <span class="crayon-k ">
                 int
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 object
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198cfe988425207-3">
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-e">
                 etc
                </span>
                <span class="crayon-v">
                 etc
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198cfe988425207-4">
               </div>
               <div class="crayon-line" id="crayon-576869c198cfe988425207-5">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 dir
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 5
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198cfe988425207-6">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 '__abs__'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 '__add__'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198cfe988425207-7">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198cfe988425207-8">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 abs
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 __doc_
                </span>
                <span class="crayon-sy">
                 _
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198cfe988425207-9">
                <span class="crayon-s">
                 'abs(number) -&gt; number
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198cfe988425207-10">
               </div>
               <div class="crayon-line" id="crayon-576869c198cfe988425207-11">
                <span class="crayon-s">
                 Return the absolute value of the argument.'
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0086 seconds] -->
        <p>
        </p>
        <p>
        </p>
        <h2>
         语法
        </h2>
        <p>
         Python中没有强制的语句终止字符，且代码块是通过缩进来指示的。缩进表示一个代码块的开始，逆缩进则表示一个代码块的结束。声明以冒号(:)字符结束，并且开启一个缩进级别。单行注释以井号字符(#)开头，多行注释则以多行字符串的形式出现。赋值（事实上是将对象绑定到名字）通过等号(“=”)实现，双等号(“==”)用于相等判断，”+=”和”-=”用于增加/减少运算(由符号右边的值确定增加/减少的值)。这适用于许多数据类型，包括字符串。你也可以在一行上使用多个变量。例如：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d0f631993950" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           &gt;&gt;&gt; myvar = 3
&gt;&gt;&gt; myvar += 2
&gt;&gt;&gt; myvar
5
&gt;&gt;&gt; myvar -= 1
&gt;&gt;&gt; myvar
4
"""This is a multiline comment.
The following lines concatenate the two strings."""
&gt;&gt;&gt; mystring = "Hello"
&gt;&gt;&gt; mystring += " world."
&gt;&gt;&gt; print mystring
Hello world.
# This swaps the variables in one line(!).
# It doesn't violate strong typing because values aren't
# actually being assigned, but new objects are bound to
# the old names.
&gt;&gt;&gt; myvar, mystring = mystring, myvar
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d0f631993950-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d0f631993950-18">
                18
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d0f631993950-1">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myvar
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-2">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myvar
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 +=
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-3">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 myvar
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-4">
                <span class="crayon-cn">
                 5
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-5">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myvar
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 -=
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-6">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 myvar
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-7">
                <span class="crayon-cn">
                 4
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-8">
                <span class="crayon-s">
                 """This is a multiline comment.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-9">
                <span class="crayon-s">
                 The following lines concatenate the two strings."""
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-10">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mystring
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "Hello"
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-11">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mystring
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 +=
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 " world."
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-12">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 mystring
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-13">
                <span class="crayon-e">
                 Hello
                </span>
                <span class="crayon-v">
                 world
                </span>
                <span class="crayon-sy">
                 .
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-14">
                <span class="crayon-c">
                 # This swaps the variables in one line(!).
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-15">
                <span class="crayon-c">
                 # It doesn't violate strong typing because values aren't
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-16">
                <span class="crayon-c">
                 # actually being assigned, but new objects are bound to
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d0f631993950-17">
                <span class="crayon-c">
                 # the old names.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d0f631993950-18">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myvar
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mystring
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mystring
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myvar
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0270 seconds] -->
        <p>
        </p>
        <h2>
         数据类型
        </h2>
        <p>
         Python具有列表（list）、元组（tuple）和字典（dictionaries）三种基本的数据结构，而集合(sets)则包含在集合库中(但从Python2.5版本开始正式成为Python内建类型)。列表的特点跟一维数组类似（当然你也可以创建类似多维数组的“列表的列表”），字典则是具有关联关系的数组（通常也叫做哈希表），而元组则是不可变的一维数组（Python中“数组”可以包含任何类型的元素，这样你就可以使用混合元素，例如整数、字符串或是嵌套包含列表、字典或元组）。数组中第一个元素索引值(下标)为0，使用负数索引值能够从后向前访问数组元素，-1表示最后一个元素。数组元素还能指向函数。来看下面的用法：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d17636742150" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           &gt;&gt;&gt; sample = [1, ["another", "list"], ("a", "tuple")]
&gt;&gt;&gt; mylist = ["List item 1", 2, 3.14]
&gt;&gt;&gt; mylist[0] = "List item 1 again" # We're changing the item.
&gt;&gt;&gt; mylist[-1] = 3.21 # Here, we refer to the last item.
&gt;&gt;&gt; mydict = {"Key 1": "Value 1", 2: 3, "pi": 3.14}
&gt;&gt;&gt; mydict["pi"] = 3.15 # This is how you change dictionary values.
&gt;&gt;&gt; mytuple = (1, 2, 3)
&gt;&gt;&gt; myfunction = len
&gt;&gt;&gt; print myfunction(mylist)
3
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d17636742150-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d17636742150-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d17636742150-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d17636742150-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d17636742150-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d17636742150-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d17636742150-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d17636742150-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d17636742150-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d17636742150-10">
                10
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d17636742150-1">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 sample
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 "another"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "list"
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-s">
                 "a"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "tuple"
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d17636742150-2">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 "List item 1"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.14
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d17636742150-3">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 0
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "List item 1 again"
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # We're changing the item.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d17636742150-4">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-o">
                 -
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.21
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # Here, we refer to the last item.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d17636742150-5">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mydict
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 {
                </span>
                <span class="crayon-s">
                 "Key 1"
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "Value 1"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "pi"
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.14
                </span>
                <span class="crayon-sy">
                 }
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d17636742150-6">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mydict
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 "pi"
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.15
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # This is how you change dictionary values.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d17636742150-7">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mytuple
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d17636742150-8">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myfunction
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 len
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d17636742150-9">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 myfunction
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d17636742150-10">
                <span class="crayon-cn">
                 3
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0248 seconds] -->
        <p>
        </p>
        <p>
         你可以使用:运算符访问数组中的某一段，如果:左边为空则表示从第一个元素开始，同理:右边为空则表示到最后一个元素结束。负数索引则表示从后向前数的位置（-1是最后一个项目），例如：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d1f975204311" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           &gt;&gt;&gt; mylist = ["List item 1", 2, 3.14]
&gt;&gt;&gt; print mylist[:]
['List item 1', 2, 3.1400000000000001]
&gt;&gt;&gt; print mylist[0:2]
['List item 1', 2]
&gt;&gt;&gt; print mylist[-3:-1]
['List item 1', 2]
&gt;&gt;&gt; print mylist[1:]
[2, 3.14]
# Adding a third parameter, "step" will have Python step in
# N item increments, rather than 1.
# E.g., this will return the first item, then go to the third and
# return that (so, items 0 and 2 in 0-indexing).
&gt;&gt;&gt; print mylist[::2]
['List item 1', 3.14]
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d1f975204311-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d1f975204311-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d1f975204311-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d1f975204311-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d1f975204311-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d1f975204311-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d1f975204311-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d1f975204311-15">
                15
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d1f975204311-1">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 "List item 1"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.14
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d1f975204311-2">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d1f975204311-3">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 'List item 1'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.1400000000000001
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d1f975204311-4">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 0
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d1f975204311-5">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 'List item 1'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d1f975204311-6">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-o">
                 -
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-o">
                 -
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d1f975204311-7">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 'List item 1'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d1f975204311-8">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d1f975204311-9">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.14
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d1f975204311-10">
                <span class="crayon-c">
                 # Adding a third parameter, "step" will have Python step in
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d1f975204311-11">
                <span class="crayon-c">
                 # N item increments, rather than 1.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d1f975204311-12">
                <span class="crayon-c">
                 # E.g., this will return the first item, then go to the third and
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d1f975204311-13">
                <span class="crayon-c">
                 # return that (so, items 0 and 2 in 0-indexing).
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d1f975204311-14">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-o">
                 ::
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d1f975204311-15">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 'List item 1'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3.14
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0223 seconds] -->
        <p>
        </p>
        <h2>
         字符串
        </h2>
        <p>
         Python中的字符串使用单引号(‘)或是双引号(“)来进行标示，并且你还能够在通过某一种标示的字符串中使用另外一种标示符(例如 “He said ‘hello’.”)。而多行字符串可以通过三个连续的单引号(”’)或是双引号(“””)来进行标示。Python可以通过u”This is a unicode string”这样的语法使用Unicode字符串。如果想通过变量来填充字符串，那么可以使用取模运算符(%)和一个元组。使用方式是在目标字符串中从左至右使用%s来指代变量的位置，或者使用字典来代替，示例如下：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d27594084911" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           &gt;&gt;&gt;print "Name: %s\
Number: %s\
String: %s" % (myclass.name, 3, 3 * "-")
Name: Poromenos
Number: 3
String: ---

strString = """This is
a multiline
string."""

# WARNING: Watch out for the trailing s in "%(key)s".
&gt;&gt;&gt; print "This %(verb)s a %(noun)s." % {"noun": "test", "verb": "is"}
This is a test.
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d27594084911-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d27594084911-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d27594084911-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d27594084911-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d27594084911-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d27594084911-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d27594084911-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d27594084911-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d27594084911-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d27594084911-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d27594084911-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d27594084911-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d27594084911-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d27594084911-14">
                14
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d27594084911-1">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "Name: %s\
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d27594084911-2">
                <span class="crayon-s">
                 Number: %s\
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d27594084911-3">
                <span class="crayon-s">
                 String: %s"
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 %
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 myclass
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 name
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 *
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "-"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d27594084911-4">
                <span class="crayon-v">
                 Name
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 Poromenos
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d27594084911-5">
                <span class="crayon-v">
                 Number
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d27594084911-6">
                <span class="crayon-k ">
                 String
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 --
                </span>
                <span class="crayon-o">
                 -
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d27594084911-7">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d27594084911-8">
                <span class="crayon-v">
                 strString
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 """This is
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d27594084911-9">
                <span class="crayon-s">
                 a multiline
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d27594084911-10">
                <span class="crayon-s">
                 string."""
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d27594084911-11">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d27594084911-12">
                <span class="crayon-c">
                 # WARNING: Watch out for the trailing s in "%(key)s".
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d27594084911-13">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "This %(verb)s a %(noun)s."
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 %
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 {
                </span>
                <span class="crayon-s">
                 "noun"
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "test"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "verb"
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "is"
                </span>
                <span class="crayon-sy">
                 }
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d27594084911-14">
                <span class="crayon-e">
                 This
                </span>
                <span class="crayon-st">
                 is
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 a
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 test
                </span>
                <span class="crayon-sy">
                 .
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0100 seconds] -->
        <p>
        </p>
        <h2>
         流程控制
        </h2>
        <p>
         Python中可以使用if、for和while来实现流程控制。Python中并没有select，取而代之使用if来实现。使用for来枚举列表中的元素。如果希望生成一个由数字组成的列表，则可以使用range(&lt;number&gt;)函数。以下是这些声明的语法示例：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d2e072433391" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           rangelist = range(10)
&gt;&gt;&gt; print rangelist
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for number in rangelist:
    # Check if number is one of
    # the numbers in the tuple.
    if number in (3, 4, 7, 9):
        # "Break" terminates a for without
        # executing the "else" clause.
        break
    else:
        # "Continue" starts the next iteration
        # of the loop. It's rather useless here,
        # as it's the last statement of the loop.
        continue
else:
    # The "else" clause is optional and is
    # executed only if the loop didn't "break".
    pass # Do nothing

if rangelist[1] == 2:
    print "The second item (lists are 0-based) is 2"
elif rangelist[1] == 3:
    print "The second item (lists are 0-based) is 3"
else:
    print "Dunno"

while rangelist[1] == 1:
    pass
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-20">
                20
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-21">
                21
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-22">
                22
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-23">
                23
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-24">
                24
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-25">
                25
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-26">
                26
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-27">
                27
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d2e072433391-28">
                28
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d2e072433391-29">
                29
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d2e072433391-1">
                <span class="crayon-v">
                 rangelist
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 range
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 10
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-2">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 rangelist
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-3">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 0
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 5
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 6
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 7
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 8
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 9
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-4">
                <span class="crayon-st">
                 for
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 number
                </span>
                <span class="crayon-st">
                 in
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 rangelist
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-5">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # Check if number is one of
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-6">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # the numbers in the tuple.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-7">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 number
                </span>
                <span class="crayon-st">
                 in
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 7
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 9
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-8">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # "Break" terminates a for without
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-9">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # executing the "else" clause.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-10">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 break
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-11">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 else
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-12">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # "Continue" starts the next iteration
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-13">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # of the loop. It's rather useless here,
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-14">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # as it's the last statement of the loop.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-15">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 continue
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-16">
                <span class="crayon-st">
                 else
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-17">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # The "else" clause is optional and is
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-18">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # executed only if the loop didn't "break".
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-19">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 pass
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # Do nothing
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-20">
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-21">
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 rangelist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 ==
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-22">
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "The second item (lists are 0-based) is 2"
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-23">
                <span class="crayon-st">
                 elif
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 rangelist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 ==
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-24">
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "The second item (lists are 0-based) is 3"
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-25">
                <span class="crayon-st">
                 else
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-26">
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "Dunno"
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-27">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d2e072433391-28">
                <span class="crayon-st">
                 while
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 rangelist
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 ==
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d2e072433391-29">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 pass
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0192 seconds] -->
        <p>
        </p>
        <h2>
         函数
        </h2>
        <p>
         函数通过“def”关键字进行声明。可选参数以集合的方式出现在函数声明中并紧跟着必选参数，可选参数可以在函数声明中被赋予一个默认值。已命名的参数需要赋值。函数可以返回一个元组（使用元组拆包可以有效返回多个值）。Lambda函数是由一个单独的语句组成的特殊函数，参数通过引用进行传递，但对于不可变类型(例如元组，整数，字符串等)则不能够被改变。这是因为只传递了该变量的内存地址，并且只有丢弃了旧的对象后，变量才能绑定一个对象，所以不可变类型是被替换而不是改变（译者注：虽然Python传递的参数形式本质上是引用传递，但是会产生值传递的效果）。例如：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d36599109836" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           # 作用等同于 def funcvar(x): return x + 1
funcvar = lambda x: x + 1
&gt;&gt;&gt; print funcvar(1)
2

# an_int 和 a_string 是可选参数，它们有默认值
# 如果调用 passing_example 时只指定一个参数，那么 an_int 缺省为 2 ，a_string 缺省为 A default string。如果调用 passing_example 时指定了前面两个参数，a_string 仍缺省为 A default string。
# a_list 是必备参数，因为它没有指定缺省值。
def passing_example(a_list, an_int=2, a_string="A default string"):
    a_list.append("A new item")
    an_int = 4
    return a_list, an_int, a_string

&gt;&gt;&gt; my_list = [1, 2, 3]
&gt;&gt;&gt; my_int = 10
&gt;&gt;&gt; print passing_example(my_list, my_int)
([1, 2, 3, 'A new item'], 4, "A default string")
&gt;&gt;&gt; my_list
[1, 2, 3, 'A new item']
&gt;&gt;&gt; my_int
10
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d36599109836-20">
                20
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d36599109836-21">
                21
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d36599109836-1">
                <span class="crayon-c">
                 # 作用等同于 def funcvar(x): return x + 1
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-2">
                <span class="crayon-v">
                 funcvar
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 lambda
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 x
                </span>
                <span class="crayon-o">
                 :
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 x
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 +
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-3">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 funcvar
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-4">
                <span class="crayon-cn">
                 2
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-5">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-6">
                <span class="crayon-c">
                 # an_int 和 a_string 是可选参数，它们有默认值
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-7">
                <span class="crayon-c">
                 # 如果调用 passing_example 时只指定一个参数，那么 an_int 缺省为 2 ，a_string 缺省为 A default string。如果调用 passing_example 时指定了前面两个参数，a_string 仍缺省为 A default string。
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-8">
                <span class="crayon-c">
                 # a_list 是必备参数，因为它没有指定缺省值。
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-9">
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 passing_example
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 a_list
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 an_int
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 a_string
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-s">
                 "A default string"
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-10">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 a_list
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 append
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-s">
                 "A new item"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-11">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 an_int
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-12">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 a_list
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 an_int
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 a_string
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-13">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-14">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 my_list
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-15">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 my_int
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-16">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 passing_example
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 my_list
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 my_int
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-17">
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 'A new item'
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "A default string"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-18">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 my
                </span>
                <span class="crayon-sy">
                 _
                </span>
                list
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-19">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 'A new item'
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d36599109836-20">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 my
                </span>
                <span class="crayon-sy">
                 _
                </span>
                int
               </div>
               <div class="crayon-line" id="crayon-576869c198d36599109836-21">
                <span class="crayon-cn">
                 10
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0068 seconds] -->
        <p>
        </p>
        <h2>
         类
        </h2>
        <p>
         Python支持有限的多继承形式。私有变量和方法可以通过添加至少两个前导下划线和最多尾随一个下划线的形式进行声明（如“__spam”，这只是惯例，而不是Python的强制要求）。当然，我们也可以给类的实例取任意名称。例如：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d3d608303001" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           class MyClass(object):
    common = 10
    def __init__(self):
        self.myvariable = 3
    def myfunction(self, arg1, arg2):
        return self.myvariable

    # This is the class instantiation
&gt;&gt;&gt; classinstance = MyClass()
&gt;&gt;&gt; classinstance.myfunction(1, 2)
3
# This variable is shared by all classes.
&gt;&gt;&gt; classinstance2 = MyClass()
&gt;&gt;&gt; classinstance.common
10
&gt;&gt;&gt; classinstance2.common
10
# Note how we use the class name
# instead of the instance.
&gt;&gt;&gt; MyClass.common = 30
&gt;&gt;&gt; classinstance.common
30
&gt;&gt;&gt; classinstance2.common
30
# This will not update the variable on the class,
# instead it will bind a new object to the old
# variable name.
&gt;&gt;&gt; classinstance.common = 10
&gt;&gt;&gt; classinstance.common
10
&gt;&gt;&gt; classinstance2.common
30
&gt;&gt;&gt; MyClass.common = 50
# This has not changed, because "common" is
# now an instance variable.
&gt;&gt;&gt; classinstance.common
10
&gt;&gt;&gt; classinstance2.common
50

# This class inherits from MyClass. The example
# class above inherits from "object", which makes
# it what's called a "new-style class".
# Multiple inheritance is declared as:
# class OtherClass(MyClass1, MyClass2, MyClassN)
class OtherClass(MyClass):
    # The "self" argument is passed automatically
    # and refers to the class instance, so you can set
    # instance variables as above, but from inside the class.
    def __init__(self, arg1):
        self.myvariable = 3
        print arg1

&gt;&gt;&gt; classinstance = OtherClass("hello")
hello
&gt;&gt;&gt; classinstance.myfunction(1, 2)
3
# This class doesn't have a .test member, but
# we can add one to the instance anyway. Note
# that this will only be a member of classinstance.
&gt;&gt;&gt; classinstance.test = 10
&gt;&gt;&gt; classinstance.test
10
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-20">
                20
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-21">
                21
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-22">
                22
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-23">
                23
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-24">
                24
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-25">
                25
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-26">
                26
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-27">
                27
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-28">
                28
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-29">
                29
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-30">
                30
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-31">
                31
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-32">
                32
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-33">
                33
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-34">
                34
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-35">
                35
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-36">
                36
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-37">
                37
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-38">
                38
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-39">
                39
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-40">
                40
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-41">
                41
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-42">
                42
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-43">
                43
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-44">
                44
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-45">
                45
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-46">
                46
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-47">
                47
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-48">
                48
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-49">
                49
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-50">
                50
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-51">
                51
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-52">
                52
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-53">
                53
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-54">
                54
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-55">
                55
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-56">
                56
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-57">
                57
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-58">
                58
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-59">
                59
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-60">
                60
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-61">
                61
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d3d608303001-62">
                62
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d3d608303001-63">
                63
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d3d608303001-1">
                <span class="crayon-t">
                 class
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 MyClass
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-k ">
                 object
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-2">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 common
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-3">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 __init__
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-4">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 myvariable
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-5">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 myfunction
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 arg1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 arg2
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-6">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 myvariable
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-7">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-8">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # This is the class instantiation
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-9">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 MyClass
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-10">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 myfunction
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-11">
                <span class="crayon-cn">
                 3
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-12">
                <span class="crayon-c">
                 # This variable is shared by all classes.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-13">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance2
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 MyClass
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-14">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-15">
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-16">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance2
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-17">
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-18">
                <span class="crayon-c">
                 # Note how we use the class name
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-19">
                <span class="crayon-c">
                 # instead of the instance.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-20">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 MyClass
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 common
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 30
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-21">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-22">
                <span class="crayon-cn">
                 30
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-23">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance2
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-24">
                <span class="crayon-cn">
                 30
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-25">
                <span class="crayon-c">
                 # This will not update the variable on the class,
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-26">
                <span class="crayon-c">
                 # instead it will bind a new object to the old
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-27">
                <span class="crayon-c">
                 # variable name.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-28">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 common
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-29">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-30">
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-31">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance2
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-32">
                <span class="crayon-cn">
                 30
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-33">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 MyClass
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 common
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 50
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-34">
                <span class="crayon-c">
                 # This has not changed, because "common" is
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-35">
                <span class="crayon-c">
                 # now an instance variable.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-36">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-37">
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-38">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance2
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 common
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-39">
                <span class="crayon-cn">
                 50
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-40">
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-41">
                <span class="crayon-c">
                 # This class inherits from MyClass. The example
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-42">
                <span class="crayon-c">
                 # class above inherits from "object", which makes
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-43">
                <span class="crayon-c">
                 # it what's called a "new-style class".
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-44">
                <span class="crayon-c">
                 # Multiple inheritance is declared as:
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-45">
                <span class="crayon-c">
                 # class OtherClass(MyClass1, MyClass2, MyClassN)
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-46">
                <span class="crayon-t">
                 class
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 OtherClass
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 MyClass
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-47">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # The "self" argument is passed automatically
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-48">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # and refers to the class instance, so you can set
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-49">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # instance variables as above, but from inside the class.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-50">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 __init__
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 arg1
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-51">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 myvariable
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-52">
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 arg1
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-53">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-54">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 OtherClass
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-s">
                 "hello"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-55">
                <span class="crayon-v">
                 hello
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-56">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 myfunction
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-57">
                <span class="crayon-cn">
                 3
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-58">
                <span class="crayon-c">
                 # This class doesn't have a .test member, but
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-59">
                <span class="crayon-c">
                 # we can add one to the instance anyway. Note
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-60">
                <span class="crayon-c">
                 # that this will only be a member of classinstance.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-61">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-k ">
                 test
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 10
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d3d608303001-62">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 classinstance
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-k ">
                 test
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d3d608303001-63">
                <span class="crayon-cn">
                 10
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0118 seconds] -->
        <p>
        </p>
        <h2>
         异常
        </h2>
        <p>
         Python中的异常由 try-except [exceptionname] 块处理，例如：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d45814020397" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           def some_function():
    try:
        # Division by zero raises an exception
        10 / 0
    except ZeroDivisionError:
        print "Oops, invalid."
    else:
        # Exception didn't occur, we're good.
        pass
    finally:
        # This is executed after the code block is run
        # and all exceptions have been handled, even
        # if a new exception is raised while handling.
        print "We're done with that."

&gt;&gt;&gt; some_function()
Oops, invalid.
We're done with that.
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d45814020397-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d45814020397-18">
                18
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d45814020397-1">
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 some_function
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-2">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 try
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-3">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # Division by zero raises an exception
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-4">
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 10
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 /
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 0
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-5">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 except
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 ZeroDivisionError
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-6">
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "Oops, invalid."
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-7">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 else
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-8">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # Exception didn't occur, we're good.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-9">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 pass
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-10">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 finally
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-11">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # This is executed after the code block is run
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-12">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # and all exceptions have been handled, even
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-13">
                <span class="crayon-h">
                </span>
                <span class="crayon-c">
                 # if a new exception is raised while handling.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-14">
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "We're done with that."
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-15">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-16">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 some_function
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d45814020397-17">
                <span class="crayon-v">
                 Oops
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 invalid
                </span>
                <span class="crayon-sy">
                 .
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d45814020397-18">
                <span class="crayon-i">
                 We
                </span>
                '
                <span class="crayon-k ">
                 re
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 done
                </span>
                <span class="crayon-st">
                 with
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 that
                </span>
                <span class="crayon-sy">
                 .
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0032 seconds] -->
        <p>
        </p>
        <h2>
         导入
        </h2>
        <p>
         外部库可以使用 import [libname] 关键字来导入。同时，你还可以用 from [libname] import [funcname] 来导入所需要的函数。例如：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d4c913036103" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           import random
from time import clock

randomint = random.randint(1, 100)
&gt;&gt;&gt; print randomint
64
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d4c913036103-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d4c913036103-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d4c913036103-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d4c913036103-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d4c913036103-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d4c913036103-6">
                6
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d4c913036103-1">
                <span class="crayon-r">
                 import
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 random
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d4c913036103-2">
                <span class="crayon-st">
                 from
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 time
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 import
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 clock
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d4c913036103-3">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d4c913036103-4">
                <span class="crayon-v">
                 randomint
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 random
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 randint
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 100
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d4c913036103-5">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 randomint
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d4c913036103-6">
                <span class="crayon-cn">
                 64
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0017 seconds] -->
        <p>
        </p>
        <h2>
         文件I / O
        </h2>
        <p>
         Python针对文件的处理有很多内建的函数库可以调用。例如，这里演示了如何序列化文件(使用pickle库将数据结构转换为字符串)：
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d52559584374" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           import pickle
mylist = ["This", "is", 4, 13327]
# Open the file C:\\binary.dat for writing. The letter r before the
# filename string is used to prevent backslash escaping.
myfile = open(r"C:\\binary.dat", "w")
pickle.dump(mylist, myfile)
myfile.close()

myfile = open(r"C:\\text.txt", "w")
myfile.write("This is a sample string")
myfile.close()

myfile = open(r"C:\\text.txt")
&gt;&gt;&gt; print myfile.read()
'This is a sample string'
myfile.close()

# Open the file for reading.
myfile = open(r"C:\\binary.dat")
loadedlist = pickle.load(myfile)
myfile.close()
&gt;&gt;&gt; print loadedlist
['This', 'is', 4, 13327]
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-20">
                20
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-21">
                21
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d52559584374-22">
                22
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d52559584374-23">
                23
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d52559584374-1">
                <span class="crayon-r">
                 import
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 pickle
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-2">
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 "This"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "is"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 13327
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-3">
                <span class="crayon-c">
                 # Open the file C:\\binary.dat for writing. The letter r before the
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-4">
                <span class="crayon-c">
                 # filename string is used to prevent backslash escaping.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-5">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 open
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-i">
                 r
                </span>
                <span class="crayon-s">
                 "C:\\binary.dat"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "w"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-6">
                <span class="crayon-k ">
                 pickle
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 dump
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 mylist
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-7">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 close
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-8">
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-9">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 open
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-i">
                 r
                </span>
                <span class="crayon-s">
                 "C:\\text.txt"
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 "w"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-10">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 write
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-s">
                 "This is a sample string"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-11">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 close
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-12">
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-13">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 open
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-i">
                 r
                </span>
                <span class="crayon-s">
                 "C:\\text.txt"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-14">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 read
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-15">
                <span class="crayon-s">
                 'This is a sample string'
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-16">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 close
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-17">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-18">
                <span class="crayon-c">
                 # Open the file for reading.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-19">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 open
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-i">
                 r
                </span>
                <span class="crayon-s">
                 "C:\\binary.dat"
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-20">
                <span class="crayon-v">
                 loadedlist
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 pickle
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 load
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-21">
                <span class="crayon-v">
                 myfile
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 close
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d52559584374-22">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 loadedlist
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d52559584374-23">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-s">
                 'This'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 'is'
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 13327
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0063 seconds] -->
        <p>
        </p>
        <h2>
         其它杂项
        </h2>
        <ul>
         <li>
          数值判断可以链接使用，例如 1&lt;a&lt;3 能够判断变量 a 是否在1和3之间。
         </li>
         <li>
          可以使用 del 删除变量或删除数组中的元素。
         </li>
         <li>
          列表推导式(List Comprehension)提供了一个创建和操作列表的有力工具。列表推导式由一个表达式以及紧跟着这个表达式的for语句构成，for语句还可以跟0个或多个if或for语句，来看下面的例子：
         </li>
        </ul>
        <p>
        </p>
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d59736451637" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           &gt;&gt;&gt; lst1 = [1, 2, 3]
&gt;&gt;&gt; lst2 = [3, 4, 5]
&gt;&gt;&gt; print [x * y for x in lst1 for y in lst2]
[3, 4, 5, 6, 8, 10, 9, 12, 15]
&gt;&gt;&gt; print [x for x in lst1 if 4 &gt; x &gt; 1]
[2, 3]
# Check if an item has a specific property.
# "any" returns true if any item in the list is true.
&gt;&gt;&gt; any([i % 3 for i in [3, 3, 4, 4, 3]])
True
# This is because 4 % 3 = 1, and 1 is true, so any()
# returns True.

# Check how many items have this property.
&gt;&gt;&gt; sum(1 for i in [3, 3, 4, 4, 3] if i == 4)
2
&gt;&gt;&gt; del lst1[0]
&gt;&gt;&gt; print lst1
[2, 3]
&gt;&gt;&gt; del lst1
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-576869c198d59736451637-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d59736451637-20">
                20
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-576869c198d59736451637-1">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 lst1
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-2">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 lst2
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 5
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-3">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 x
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 *
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 y
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 for
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 x
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 in
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 lst1
                </span>
                <span class="crayon-st">
                 for
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 y
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 in
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 lst2
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-4">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 5
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 6
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 8
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 10
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 9
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 12
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 15
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-5">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-i">
                 x
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 for
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 x
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 in
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 lst1
                </span>
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 &gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 x
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 &gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-6">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-7">
                <span class="crayon-c">
                 # Check if an item has a specific property.
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-8">
                <span class="crayon-c">
                 # "any" returns true if any item in the list is true.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-9">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 any
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 i
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 %
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 for
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 i
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 in
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-10">
                <span class="crayon-t">
                 True
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-11">
                <span class="crayon-c">
                 # This is because 4 % 3 = 1, and 1 is true, so any()
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-12">
                <span class="crayon-c">
                 # returns True.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-13">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-14">
                <span class="crayon-c">
                 # Check how many items have this property.
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-15">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 sum
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 for
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 i
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 in
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 i
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 ==
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 4
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-16">
                <span class="crayon-cn">
                 2
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-17">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 del
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 lst1
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 0
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-18">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 print
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-i">
                 lst1
                </span>
               </div>
               <div class="crayon-line" id="crayon-576869c198d59736451637-19">
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 2
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 3
                </span>
                <span class="crayon-sy">
                 ]
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-576869c198d59736451637-20">
                <span class="crayon-o">
                 &gt;&gt;&gt;
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 del
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 lst1
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0093 seconds] -->
        <p>
        </p>
        <ul>
         <li>
          全局变量在函数之外声明，并且可以不需要任何特殊的声明即能读取，但如果你想要修改全局变量的值，就必须在函数开始之处用global关键字进行声明，否则Python会将此变量按照新的局部变量处理（请注意，如果不注意很容易被坑）。例如：
         </li>
         <li>
          <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
          <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576869c198d61194883767" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
           <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
            <span class="crayon-title">
            </span>
            <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
             <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-wrap-button" title="切换自动换行">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-expand-button" title="点击展开代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-copy-button" title="复制代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
              <div class="crayon-button-icon">
              </div>
             </div>
             <span class="crayon-language">
              Python
             </span>
            </div>
           </div>
           <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
           </div>
           <div class="crayon-plain-wrap">
            <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
             number = 5

def myfunc():
    # This will print 5.
    print number

def anotherfunc():
    # This raises an exception because the variable has not
    # been bound before printing. Python knows that it an
    # object will be bound to it later and creates a new, local
    # object instead of accessing the global one.
    print number
    number = 3

def yetanotherfunc():
    global number
    # This will correctly change the global.
    number = 3
            </textarea>
           </div>
           <div class="crayon-main" style="">
            <table class="crayon-table">
             <tbody>
              <tr class="crayon-row">
               <td class="crayon-nums " data-settings="show">
                <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-1">
                  1
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-2">
                  2
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-3">
                  3
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-4">
                  4
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-5">
                  5
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-6">
                  6
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-7">
                  7
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-8">
                  8
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-9">
                  9
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-10">
                  10
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-11">
                  11
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-12">
                  12
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-13">
                  13
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-14">
                  14
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-15">
                  15
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-16">
                  16
                 </div>
                 <div class="crayon-num" data-line="crayon-576869c198d61194883767-17">
                  17
                 </div>
                 <div class="crayon-num crayon-striped-num" data-line="crayon-576869c198d61194883767-18">
                  18
                 </div>
                </div>
               </td>
               <td class="crayon-code">
                <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
                 <div class="crayon-line" id="crayon-576869c198d61194883767-1">
                  <span class="crayon-v">
                   number
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-cn">
                   5
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-2">
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-3">
                  <span class="crayon-r">
                   def
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-e">
                   myfunc
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   :
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-4">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-c">
                   # This will print 5.
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-5">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-k ">
                   print
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-e">
                   number
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-6">
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-7">
                  <span class="crayon-r">
                   def
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-e">
                   anotherfunc
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   :
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-8">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-c">
                   # This raises an exception because the variable has not
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-9">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-c">
                   # been bound before printing. Python knows that it an
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-10">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-c">
                   # object will be bound to it later and creates a new, local
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-11">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-c">
                   # object instead of accessing the global one.
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-12">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-k ">
                   print
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-e">
                   number
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-13">
                  <span class="crayon-e">
                  </span>
                  <span class="crayon-v">
                   number
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-cn">
                   3
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-14">
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-15">
                  <span class="crayon-r">
                   def
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-e">
                   yetanotherfunc
                  </span>
                  <span class="crayon-sy">
                   (
                  </span>
                  <span class="crayon-sy">
                   )
                  </span>
                  <span class="crayon-o">
                   :
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-16">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-m">
                   global
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-v">
                   number
                  </span>
                 </div>
                 <div class="crayon-line" id="crayon-576869c198d61194883767-17">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-c">
                   # This will correctly change the global.
                  </span>
                 </div>
                 <div class="crayon-line crayon-striped-line" id="crayon-576869c198d61194883767-18">
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-v">
                   number
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-o">
                   =
                  </span>
                  <span class="crayon-h">
                  </span>
                  <span class="crayon-cn">
                   3
                  </span>
                 </div>
                </div>
               </td>
              </tr>
             </tbody>
            </table>
           </div>
          </div>
          <!-- [Format Time: 0.0031 seconds] -->
          <br/>
         </li>
        </ul>
        <h2>
         小结
        </h2>
        <p>
         本教程并未涵盖Python语言的全部内容(甚至连一小部分都称不上)。Python有非常多的库以及很多的功能特点需要学习，所以要想学好Python你必须在此教程之外通过其它方式，例如阅读Dive into Python。我希望这个教程能给你一个很好的入门指导。如果你觉得本文还有什么地方值得改进或添加，或是你希望能够了解Python的哪方面内容，请留言。
        </p>
       </div>
       <div class="entry-content content2">
        <div class="adsense">
        </div>
        <div class="src_en">
         <p>
          本文最初发表在
          <a href="http://blog.jobbole.com/43922/" rel="nofollow" target="_blank">
           伯乐在线
          </a>
          ，文章内容属作者个人观点，不代表本站立场。
         </p>
        </div>
       </div>
      </div>
      <div>
       <strong>
        注：转载文章均来自于公开网络，仅供学习使用，不会用于任何商业用途，如果侵犯到原作者的权益，请您与我们联系删除或者授权事宜，联系邮箱：contact@dataunion.org。转载数盟网站文章请注明原文章作者，否则产生的任何版权纠纷与数盟无关。
       </strong>
      </div>
      <!--content_text-->
      <div class="fenxian">
       <!-- JiaThis Button BEGIN -->
       <div class="jiathis_style_32x32">
        <p class="jiathis_button_weixin">
        </p>
        <p class="jiathis_button_tsina">
        </p>
        <p class="jiathis_button_qzone">
        </p>
        <p class="jiathis_button_cqq">
        </p>
        <p class="jiathis_button_tumblr">
        </p>
        <a class="jiathis jiathis_txt jtico jtico_jiathis" href="http://www.jiathis.com/share" target="_blank">
        </a>
        <p class="jiathis_counter_style">
        </p>
       </div>
       <!-- JiaThis Button END -->
      </div>
     </article>
     <!--content-->
     <!--相关文章-->
     <div class="xianguan">
      <div class="xianguantitle">
       相关文章！
      </div>
      <ul class="pic">
       <li>
        <a href="http://dataunion.org/24678.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/06/20140917125452915416-216x200.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24678.html" rel="bookmark" title="python3中的正则模块">
         python3中的正则模块
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/24675.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/06/t015b337bd75d9ef893-161x200.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24675.html" rel="bookmark" title="注释是恶魔，请不要再写一行注释">
         注释是恶魔，请不要再写一行注释
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/24660.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/06/u16130037972892789947fm21gp0-300x157.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24660.html" rel="bookmark" title="如何从Github上轻松安装R包">
         如何从Github上轻松安装R包
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/24654.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/06/df53fac99fc53ba5a90666abcca25e6d_b-267x200.png"/>
        </a>
        <a class="link" href="http://dataunion.org/24654.html" rel="bookmark" title="简单形象又有趣地说说强大的神经网络">
         简单形象又有趣地说说强大的神经网络
        </a>
       </li>
      </ul>
     </div>
     <!--相关文章-->
     <div class="comment" id="comments">
      <!-- You can start editing here. -->
      <!-- If comments are open, but there are no comments. -->
      <div class="title">
       期待你一针见血的评论，Come on！
      </div>
      <div id="respond">
       <p>
        不用想啦，马上
        <a href="http://dataunion.org/wp-login.php?redirect_to=http%3A%2F%2Fdataunion.org%2F24107.html">
         "登录"
        </a>
        发表自已的想法.
       </p>
      </div>
     </div>
     <!-- .nav-single -->
    </div>
    <!--Container End-->
    <aside id="sitebar">
     <div class="sitebar_list2">
      <div class="wptag">
       <span class="tagtitle">
        热门标签+
       </span>
       <div class="tagg">
        <ul class="menu" id="menu-%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1605" id="menu-item-1605">
          <a href="http://taidizh.com/">
           泰迪智慧
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20884" id="menu-item-20884">
          <a href="http://www.transwarp.cn/">
           星环科技
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-3538" id="menu-item-3538">
          <a href="http://datall.org/">
           珈和遥感
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20888" id="menu-item-20888">
          <a href="http://www.chinahadoop.cn/">
           小象学院
          </a>
         </li>
        </ul>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <div class="textwidget">
       <div align="center">
        <a href="http://study.163.com/course/courseMain.htm?courseId=991022" target="_blank">
         <img src="http://dataunion.org/wp-content/uploads/2016/03/dv.jpg"/>
        </a>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       文章分类
      </h4>
      <div class="tagcloud">
       <a class="tag-link-44" href="http://dataunion.org/category/industry/demo" style="font-size: 10.204724409449pt;" title="4个话题">
        Demo展示
       </a>
       <a class="tag-link-31" href="http://dataunion.org/category/experts" style="font-size: 15.826771653543pt;" title="52个话题">
        专家团队
       </a>
       <a class="tag-link-870" href="http://dataunion.org/category/tech/ai" style="font-size: 19.795275590551pt;" title="273个话题">
        人工智能
       </a>
       <a class="tag-link-488" href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f" style="font-size: 8pt;" title="1个话题">
        加入数盟
       </a>
       <a class="tag-link-869" href="http://dataunion.org/category/tech/viz" style="font-size: 17.204724409449pt;" title="93个话题">
        可视化
       </a>
       <a class="tag-link-30" href="http://dataunion.org/category/partners" style="font-size: 10.645669291339pt;" title="5个话题">
        合作伙伴
       </a>
       <a class="tag-link-889" href="http://dataunion.org/category/parterc" style="font-size: 11.582677165354pt;" title="8个话题">
        合作会议
       </a>
       <a class="tag-link-104" href="http://dataunion.org/category/books" style="font-size: 12.96062992126pt;" title="15个话题">
        图书
       </a>
       <a class="tag-link-220" href="http://dataunion.org/category/tech/base" style="font-size: 19.850393700787pt;" title="281个话题">
        基础架构
       </a>
       <a class="tag-link-219" href="http://dataunion.org/category/tech/analysis" style="font-size: 19.409448818898pt;" title="232个话题">
        数据分析
       </a>
       <a class="tag-link-887" href="http://dataunion.org/category/tech/dm" style="font-size: 13.291338582677pt;" title="17个话题">
        数据挖掘
       </a>
       <a class="tag-link-34" href="http://dataunion.org/category/tech" style="font-size: 20.732283464567pt;" title="404个话题">
        文章
       </a>
       <a class="tag-link-1" href="http://dataunion.org/category/uncategorized" style="font-size: 22pt;" title="693个话题">
        未分类
       </a>
       <a class="tag-link-4" href="http://dataunion.org/category/events" style="font-size: 14.503937007874pt;" title="29个话题">
        活动
       </a>
       <a class="tag-link-890" href="http://dataunion.org/category/tech/%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0" style="font-size: 10.204724409449pt;" title="4个话题">
        深度学习
       </a>
       <a class="tag-link-221" href="http://dataunion.org/category/tech/devl" style="font-size: 18.968503937008pt;" title="193个话题">
        编程语言
       </a>
       <a class="tag-link-888" href="http://dataunion.org/category/career" style="font-size: 15.661417322835pt;" title="48个话题">
        职业规划
       </a>
       <a class="tag-link-5" href="http://dataunion.org/category/jobs" style="font-size: 14.11811023622pt;" title="25个话题">
        职位
       </a>
       <a class="tag-link-871" href="http://dataunion.org/category/industry" style="font-size: 15.716535433071pt;" title="49个话题">
        行业
       </a>
       <a class="tag-link-613" href="http://dataunion.org/category/industry/case" style="font-size: 16.984251968504pt;" title="84个话题">
        行业应用
       </a>
       <a class="tag-link-885" href="http://dataunion.org/category/industry/news" style="font-size: 17.425196850394pt;" title="102个话题">
        行业资讯
       </a>
       <a class="tag-link-10" href="http://dataunion.org/category/training" style="font-size: 14.228346456693pt;" title="26个话题">
        课程
       </a>
       <a class="tag-link-16" href="http://dataunion.org/category/sources" style="font-size: 15.661417322835pt;" title="48个话题">
        资源
       </a>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       功能
      </h4>
      <ul>
       <li>
        <a href="http://dataunion.org/wp-login.php?action=register">
         注册
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/wp-login.php">
         登录
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/feed">
         文章
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/comments/feed">
         评论
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="https://cn.wordpress.org/" title="基于WordPress，一个优美、先进的个人信息发布平台。">
         WordPress.org
        </a>
       </li>
      </ul>
     </div>
    </aside>
    <div class="clear">
    </div>
   </div>
   <!--main-->
   ﻿
   <footer id="dibu">
    <div class="about">
     <div class="right">
      <ul class="menu" id="menu-%e5%ba%95%e9%83%a8%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18024" id="menu-item-18024">
        <a href="http://dataunion.org/category/partners">
         合作伙伴
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20881" id="menu-item-20881">
        <a href="http://dataunion.org/contribute">
         文章投稿
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20872" id="menu-item-20872">
        <a href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f">
         加入数盟
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22441" id="menu-item-22441">
        <a href="http://dataunion.org/f-links">
         友情链接
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20874" id="menu-item-20874">
        <a href="http://dataunion.org/aboutus">
         关于数盟
        </a>
       </li>
      </ul>
      <p class="banquan">
       数盟社区        ，
        做最棒的数据科学社区
      </p>
     </div>
     <div class="left">
      <ul class="bottomlist">
       <li>
        <a href="http://weibo.com/DataScientistUnion  " target="_blank" 　title="">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weibo.png"/>
        </a>
       </li>
       <li>
        <a class="cd-popup-trigger" href="http://dataunion.org/24107.html#0">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weixin.png"/>
        </a>
       </li>
      </ul>
      <div class="cd-popup">
       <div class="cd-popup-container">
        <h1>
         扫描二维码,加微信公众号
        </h1>
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/2014-12-06-1515289049.png"/>
        <a class="cd-popup-close" href="http://dataunion.org/24107.html">
        </a>
       </div>
       <!-- cd-popup-container -->
      </div>
      <!-- cd-popup -->
     </div>
    </div>
    <!--about-->
    <div class="bottom">
     <a href="http://dataunion.org/">
      数盟社区
     </a>
     <a href="http://www.miitbeian.gov.cn/" rel="external nofollow" target="_blank">
      京ICP备14026740号
     </a>
     联系我们：
     <a href="mailto:contact@dataunion.org" target="_blank">
      contact@dataunion.org
     </a>
     <div class="tongji">
     </div>
     <!--bottom-->
     <div class="scroll" id="scroll" style="display:none;">
      ︿
     </div>
    </div>
   </footer>
   <!--dibu-->
  </div>
 </body>
</html>